import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 用户-查询价格-获取列表
export const GET_QUOTATION_SEARCH = (params) => {
    return axios({
        url: 'quotation/search',
        method: 'GET',
        params,
    })
}

// 用户-查询价格-导出excel
export const DOWNLOAD_QUOTATION_EXPORT = BASEURL + 'quotation/export'

// 用户-申请报告-获取列表
export const GET_REPORT_SEARCH = (params) => {
    return axios({
        url: 'oralcavity/report/search',
        method: 'GET',
        params,
    })
}

// 用户-申请报告-导出excel
export const DOWNLOAD_REPORT_EXPORT = BASEURL + 'oralcavity/report/export'

// 用户-机构入住-获取列表
export const GET_ORGANIZATION_SEARCH = (params) => {
    return axios({
        url: 'organization/assigned/search',
        method: 'GET',
        params,
    })
}

// 用户-机构入住-导出excel
export const DOWNLOAD_ORGANIZATION_EXPORT = BASEURL + 'organization/assigned/export'

// 用户-平台用户-获取列表
export const GET_PLATFORM_CCUSER_SEARCH = (params) => {
    return axios({
        url: 'platform/ccuser/search',
        method: 'GET',
        params,
    })
}

// 用户-用户评论-获取列表
export const GET_COMMENT_SEARCH = (params) => {
    return axios({
        url: 'comment/search',
        method: 'GET',
        params,
    })
}

// 用户-用户评论-删除评论
export const DELETE_COMMENT_INFO = (params) => {
    return axios({
        url: 'comment/delete',
        method: 'GET',
        params,
    })
}

// 用户-用户评论-上下架评论
export const STARTSTOP_COMMENT_INFO = (params) => {
    return axios({
        url: 'comment/startstop',
        method: 'GET',
        params,
    })
}

// 用户-用户评论-新增评论
export const ADD_COMMENT_INFO = (params) => {
    return axios({
        url: 'comment/add',
        method: 'POST',
        data:params,
    })
}

// 用户-用户评论-编辑评论
export const EDIT_COMMENT_INFO = (params) => {
    return axios({
        url: 'comment/edit',
        method: 'POST',
        data:params,
    })
}

// 用户-用户评论-获取评论详情
export const GET_COMMENT_INFO = (params) => {
    return axios({
        url: 'comment/info',
        method: 'GET',
        params,
    })
}

// 用户-在线预约-获取列表
export const GET_APPOINTMENT_SEARCH = (params) => {
    return axios({
        url: 'appointment/search',
        method: 'GET',
        params,
    })
}

// 用户-在线预约-导出excel
export const DOWNLOAD_APPOINTMENT_EXPORT = BASEURL + 'appointment/export'